home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’92 / PowerBook Pixels™ 1.0.1 / PowerPixels / ShowCursor Patch.c < prev    next >
Encoding:
Text File  |  1992-06-17  |  847 b   |  59 lines  |  [TEXT/KAHL]

  1. //    Patch for ShowCursor to null out a few pixels
  2.  
  3. void main ( void ) ;
  4. void do_it ( void ) ;
  5.  
  6.  
  7. void
  8. main ( void )
  9. {
  10.     long foo ;
  11.  
  12.     asm {
  13.  
  14.         movem.l d0-d7/a0-a4 , -(a7)
  15.         jmp @next
  16.     literal:
  17.         dc.w 0xeeee
  18.         dc.w 0xeeee
  19.     next:
  20.         move.l @literal , foo
  21.     }
  22.  
  23.         do_it ( ) ; // Well, do it !
  24.  
  25.     asm {
  26.         movem.l (a7)+ , d0-d7/a0-a4
  27.         move.l foo , a0
  28.         unlk a6
  29.         jmp (a0)
  30.     }
  31. }
  32.  
  33.  
  34. void
  35. do_it ( void )
  36. {
  37.     register long base ;
  38.     register long row ;
  39.     register char * tmp ;
  40.  
  41.     base = ( long ) WMgrPort -> portBits . baseAddr ;
  42.     row = WMgrPort -> portBits . rowBytes ;
  43.     if ( row > 0 ) {
  44.  
  45.         tmp = ( char * ) base + row * 11 + ( 590 >> 3 ) ;
  46.         * tmp &= 0xef ;
  47.  
  48.         tmp = ( char * ) base + row * 200 + ( 320 >> 3 ) ;
  49.         * tmp &= 0x7e ;
  50.  
  51.         tmp = ( char * ) base + row * 302 + ( 110 >> 3 ) ;
  52.         * tmp &= 0xef ;
  53.  
  54.         tmp = ( char * ) base + row * 10 + 2 ;
  55.         * tmp &= 0xfe ;
  56.  
  57.     }
  58. }
  59.